package com.gateway.jug.logic;

public class Speedometer {

	public static double nanoseconds = 1000; // equals 1ms
	public static double microseconds = 1000; // equals 1 millisecond
	public static double milliseconds = 1000; // equals 1 second
	public static double seconds = 60; // equals 1 min
	public static double minutes = 60; // equals 1 hour
	
	public static double computeMPH(double distance, double time) {
		double timeInFractionsOfAnHour = 
			(((((time / nanoseconds) / microseconds) / milliseconds) / seconds) / minutes);
		
		double mph = distance / timeInFractionsOfAnHour;
		return mph;
	}
	
}
